package ncku.account.event.old;

import ncku.account.data.*;

public class listTransaction {
	
	public void listTransaction(){
		String[] result;
		for(int i = 0; i < GlobalData.getTransactionNumber(); i++){
			System.out.println("(" + (i+1) + ")");
			System.out.println("Date: " + GlobalData.getTransaction(i).getDate());
			System.out.println("Description: " + GlobalData.getTransaction(i).getDescription());;
			System.out.println("Amount: " + GlobalData.getTransaction(i).getStringAmount());
			System.out.println("Category: " + GlobalData.getTransaction(i).getCategory());
			for(int j = 0; j< GlobalData.getTransaction(i).getSubTransactionNumber(); j++){
				System.out.println("SubTransaction description: " + GlobalData.getTransaction(i).getSubTrans(j).getSubDescription());
				System.out.println("SubTransaction amount: " + GlobalData.getTransaction(i).getSubTrans(j).getSubStringAmount());
			}
		}
	}
}
